<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <title>第一种头部</title>
    <link rel="stylesheet" type="text/css" href="../../../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../../../css/common.css" />
    <link rel="stylesheet" type="text/css" href="../../../css/aui-pull-refresh.css" />
    <link rel="stylesheet" type="text/css" href="../../../css/aui.css" />
    <style>
        html,
        body {
            width: 100%;
            min-height: 100%;
            background: #f7f7f7;
            line-height: 1;
        }
        /*修改icon*/

        .left_icon {
            font-size: 1rem!important;
            color: #000!important;
        }
        /*修改头部标题*/

        .header_title {
            font-size: 0.9rem;
            font-weight: bold;
        }
        /*固定头部*/

        .header {
            background-color: #fff;
            border: none!important;
            z-index: 8!important;
        }
    </style>
</head>

<body>
    <header class="aui-bar aui-bar-nav header" id='header' style="padding-top:25px;">
        <a class="aui-pull-left aui-btn" onclick="close_win()">
            <span class="aui-iconfont aui-icon-left left_icon"></span>
        </a>
        <div class="aui-title header_title">第一种头部</div>
    </header>

</body>
<script type="text/javascript" src="../../../script/api.js"></script>
<script type="text/javascript" src="../../../script/jquery.min.js"></script>
<script type="text/javascript" src="../../../script/vue.min.js"></script>
<script type="text/javascript" src="../../../script/utils.js"></script>
<script type="text/javascript" src="../../../script/common.js"></script>
<script type="text/javascript" src="../../../script/aui-tab.js"></script>
<script type="text/javascript" src="../../../script/aui-scroll.js"></script>
<script type="text/javascript" src="../../../script/aui-pull-refresh.js"></script>
<script type="text/javascript">
    apiready = function() {

        //获取header的高度
        var oHeader = $api.byId("header");
        var headerH = $api.offset(oHeader).h;

        if (api.pageParam.title == "添加新的朋友") {
            $('.header_title').html('新的朋友');
            api.openFrame({
                name: 'search_new_friend',
                url: '../search_new_friend.html',
                rect: {
                    x: 0,
                    y: headerH,
                    w: 'auto',
                    h: 'auto'
                },
                pageParam: {
                    name: 'test'
                },
                bounces: true,
                bgColor: 'rgba(0,0,0,0)',
                vScrollBarEnabled: true,
                hScrollBarEnabled: true
            });

        } else if (api.pageParam.title == "我的群聊") {
            $('.header_title').html('我的群聊');
            api.openFrame({
                name: 'my_chat_group',
                url: '../my_chat_group.html',
                rect: {
                    x: 0,
                    y: headerH,
                    w: 'auto',
                    h: 'auto'
                },
                pageParam: {
                    name: 'test'
                },
                bounces: true,
                bgColor: 'rgba(0,0,0,0)',
                vScrollBarEnabled: true,
                hScrollBarEnabled: true
            });
        } else if (api.pageParam.type == "动态详情") {
            $('.header_title').html(api.pageParam.title);
            api.openFrame({
                name: 'friend_person_list_detail',
                url: '../friend_person_list_detail.html',
                rect: {
                    x: 0,
                    y: headerH,
                    w: 'auto',
                    h: 'auto'
                },
                pageParam: {
                    dynamic_id:api.pageParam.dynamic_id
                },
                bounces: false,
                bgColor: 'rgba(0,0,0,0)',
                vScrollBarEnabled: true,
                hScrollBarEnabled: true
            });
        } else if (api.pageParam.type == "回复详情") {
            $('.header_title').html(api.pageParam.title);
            api.openFrame({
                name: 'friend_comment_detail',
                url: '../friend_comment_detail.html',
                rect: {
                    x: 0,
                    y: headerH,
                    w: 'auto',
                    h: 'auto'
                },
                pageParam: {
                    hf_pl_id:api.pageParam.hf_pl_id
                },
                bounces: false,
                bgColor: 'rgba(0,0,0,0)',
                vScrollBarEnabled: true,
                hScrollBarEnabled: true
            });
        } else if (api.pageParam.type == "群资料") {
            $('.header_title').html(api.pageParam.title);
            api.openFrame({
                name: 'chat_group_detail',
                url: '../chat_group_detail.html',
                rect: {
                    x: 0,
                    y: headerH,
                    w: 'auto',
                    h: 'auto'
                },
                pageParam: {
                    group_chat_id:api.pageParam.group_chat_id,
                },
                bounces: false,
                bgColor: 'rgba(0,0,0,0)',
                vScrollBarEnabled: true,
                hScrollBarEnabled: true
            });
        }else if (api.pageParam.type == "验证") {
            $('.header_title').html(api.pageParam.title);
            if(api.pageParam.is_friend==0||api.pageParam.is_friend==2){
              api.openFrame({
                  name: 'verification_friend',
                  url: '../verification_friend.html',
                  rect: {
                      x: 0,
                      y: headerH,
                      w: 'auto',
                      h: 'auto'
                  },
                  pageParam: {
                      target_id:api.pageParam.target_id,
                      agree_id:api.pageParam.agree_id
                  },
                  bounces: false,
                  bgColor: 'rgba(0,0,0,0)',
                  vScrollBarEnabled: true,
                  hScrollBarEnabled: true
              });
            }else{
              console.log("111+"+api.pageParam.is_friend);
              api.openFrame({
                  name: 'friend_detail',
                  url: '../friend_detail.html',
                  rect: {
                      x: 0,
                      y: headerH,
                      w: 'auto',
                      h: 'auto'
                  },
                  pageParam: {
                      friend_id:api.pageParam.target_id
                  },
                  bounces: true,
                  bgColor: 'rgba(0,0,0,0)',
                  vScrollBarEnabled: true,
                  hScrollBarEnabled: true
              });
            }

        } else if (api.pageParam.type == "商品选择") {
            $('.header_title').html(api.pageParam.title);
            api.openFrame({
                name: 'chose_collection_shop',
                url: '../chose_collection_shop.html',
                rect: {
                    x: 0,
                    y: headerH,
                    w: 'auto',
                    h: 'auto'
                },
                pageParam: {

                },
                bounces: true,
                bgColor: 'rgba(0,0,0,0)',
                vScrollBarEnabled: true,
                hScrollBarEnabled: true
            });
        }if (api.pageParam.title == "手机通讯录") {
            $('.header_title').html('手机通讯录');
            api.openFrame({
                name: 'phone_mail_list',
                url: '../phone_mail_list.html',
                rect: {
                    x: 0,
                    y: headerH,
                    w: 'auto',
                    h: 'auto'
                },
                pageParam: {
                    name: 'test'
                },
                bounces: true,
                bgColor: 'rgba(0,0,0,0)',
                vScrollBarEnabled: true,
                hScrollBarEnabled: true
            });

        }
    };


    // 关闭当前窗口
    function close_win() {
        api.closeWin({});

        $api.rmStorage('shop_id')
        // api.execScript({
        //     name: 'four_frame/four_index.html',
        //     frameName: 'friend_list',
        //     script: 'window.location.reload();'
        // });

    }
</script>

</html>
